package io.github.talelin.latticy.model;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import io.github.talelin.latticy.bo.StockBO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.kie.api.definition.rule.All;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * 库存
 *
 * @author generator@wulongbo
 * @since 2022-06-28
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("stock")
@NoArgsConstructor
@AllArgsConstructor
public class StockDO extends BaseModel {


    /**
     * 仓库代码
     */
    private String warehouseCode;

    /**
     * 客户代码
     */
    private String tenant;

    /**
     * 产品代码
     */
    private String sku;

    /**
     * 产品名称
     */
    private String skuName;

    /**
     * 在途
     */
    private Long onTheWay;

    /**
     * 待上架
     */
    private Long onThePutAway;

    /**
     * 可用库存(已上架)
     */
    private Long availableStock;

    /**
     * 不良品(上架到不良品区)
     */
    private Long rejects;

    /**
     * 待出库
     */
    private Long toBeDelivered;

    /**
     * 已出库
     */
    private Long delivered;

    /**
     * 暂存区
     */
    private Long workingArea;

    private Date productTime;

    @Version
    private Integer version;

    public StockDO(StockBO stockBO){
        BeanUtils.copyProperties(stockBO, this);
    }
}
